//
//  ZPBFirstGetModel.m
//  
//
//  Created by boys on 16/3/22.
//
//

#import "ZPBFirstGetModel.h"
#import "ZPBSecondGetModel.h"

@implementation ZPBFirstGetModel
//赋值方法
- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    
    
    
    if ([key isEqualToString:@"data"]) {
        NSMutableArray *tempArr = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            ZPBSecondGetModel *model = [[ZPBSecondGetModel alloc] init];
            [model setValuesForKeysWithDictionary:dic];
            [tempArr addObject:model];
        }
        self.data = [NSArray arrayWithArray:tempArr];
    }

    if ([key isEqualToString:@"action"]) {
        self.action = value[@"type"];
    }
    

}

//容错方法
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"id"]) {
        self.Uid = value;
    }
//    if ([key isEqualToString:@"data"]) {
//        
//        self.name = value[@"name"];
//       
//
//    }
}


@end
